// 装饰器日志

function logMethod(target: any, key: string, descriptor: PropertyDescriptor) {
  const original = descriptor.value;
  descriptor.value = function (...args: any[]) {
    console.log(`Call ${key} with ${args}`);
    return original(...args);
  };
}

class UserService {
  @logMethod
  getUser(id: string) { return { id }; }
}